import Vue from "vue";
import VueRouter from "vue-router";
import Login from "@/views/Login.vue";
import Home from "@/views/Home.vue";
import Article from "../views/article.vue";
import Publish from "../views/publish.vue";
Vue.use(VueRouter);
const routes = [
  {
    path: "",
    redirect: "/article"
  },
  {
    path: "/",
    component: Home,
    meta: {
      breadcrumb: "后台首页"
    },
    children: [
      {
        path: "article",
        component: Article,
        meta: {
          breadcrumb: "文章列表"
        }
      },
      {
        path: "publish",
        component: Publish,
        meta: {
          breadcrumb: "编辑页面"
        }
      }
    ]
  },
  {
    path: "/login",
    component: Login
  }
];

const router = new VueRouter({
  routes,
  mode: "history"
});

export default router;
